package com.zdb.demo.design.pattern.structural.adapter;

public class PowerAdapter implements DC5V {

    private AC220V ac220V;

    public PowerAdapter(AC220V ac220V) {
        this.ac220V = ac220V;
    }

    @Override
    public int outputDC5V() {
        int input = ac220V.outputAC220V();

        // 变压器
        int output = input / 44;
        System.out.println("电源适配器，输入AC：" + input + "V,输出DC:" + output + "V");

        return output;
    }
}
